const mysql = require('mysql2')

const { database } = require('../env')
const { host, name, username, password, port } = database

const pool = mysql.createPool({
    host,
    port,
    user: username,
    password,
    database: name,
})

module.exports = pool.promise()